package gupao.concurrency.demo.risk.calc.simulator;

import java.util.Random;
import java.util.concurrent.TimeUnit;
//simulate time cost
public class TimeConsumeSimulator {
    private final static Random r = new Random();

    public static void consumeTimeToCalcQaf(){
        try {
            TimeUnit.MILLISECONDS.sleep(1L + r.nextInt(6));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void consumeTimeToCalcCapital(){
        try {
            TimeUnit.MILLISECONDS.sleep(1L + r.nextInt(4));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
